package com.github.catvod.spider.merge;

import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.regex.Pattern;
import org.json.JSONObject;

public class CE {
  public static Charset V0;
  
  private static final Pattern h = Pattern.compile("http((?!http).)*?default\\.365yg\\.com/.*|http((?!http).){26,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\\?.*|http((?!http).){26,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)|http((?!http).){26,}?/m3u8\\?pt=m3u8.*|http((?!http).)*?default\\.ixigua\\.com/.*|http((?!http).)*?cdn-tos[^\\?]*|http((?!http).)*?/obj/tos[^\\?]*|http.*?/player/m3u8play\\.php\\?url=.*|http.*?/player/.*?[pP]lay\\.php\\?url=.*|http.*?/playlist/m3u8/\\?vid=.*|http.*?\\.php\\?type=m3u8&.*|http.*?/download.aspx\\?.*|http.*?/api/up_api.php\\?.*|https.*?\\.66yk\\.cn.*|http((?!http).)*?netease\\.com/file/.*");
  
  public static Charset j;
  
  public static Charset q;
  
  static {
    V0 = Charset.forName("UTF-8");
    j = Charset.forName("iso-8859-1");
    q = Charset.forName("gb2312");
  }
  
  public static JSONObject BQ(String paramString1, String paramString2) {
    String str1;
    JSONObject jSONObject3 = new JSONObject(paramString2);
    String str2 = jSONObject3.getString("url");
    paramString2 = str2;
    if (str2.startsWith("//")) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append("https:");
      stringBuilder.append(str2);
      str1 = stringBuilder.toString();
    } 
    if (!str1.startsWith("http"))
      return null; 
    if (str1.equals(paramString1) && (oC(str1) || !I(str1)))
      return null; 
    if (q(paramString1, str1))
      return null; 
    JSONObject jSONObject2 = new JSONObject();
    String str4 = jSONObject3.optString("user-agent", "");
    if (str4.trim().length() > 0) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append(" ");
      stringBuilder.append(str4);
      jSONObject2.put("User-Agent", stringBuilder.toString());
    } 
    String str3 = jSONObject3.optString("referer", "");
    if (str3.trim().length() > 0) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append(" ");
      stringBuilder.append(str3);
      jSONObject2.put("Referer", stringBuilder.toString());
    } 
    jSONObject2 = j(jSONObject2, paramString1, str1);
    JSONObject jSONObject1 = new JSONObject();
    jSONObject1.put("header", jSONObject2);
    jSONObject1.put("parse", 0);
    jSONObject1.put("jx", 0);
    jSONObject1.put("url", str1);
    return jSONObject1;
  }
  
  public static boolean I(String paramString) {
    return h.matcher(paramString).find() ? (!paramString.contains(".js")) : false;
  }
  
  public static String V0(String paramString) {
    try {
      byte[] arrayOfByte = MessageDigest.getInstance("SHA-1").digest(paramString.getBytes());
      StringBuilder stringBuilder = new StringBuilder();
      this();
      int i = arrayOfByte.length;
      for (byte b = 0; b < i; b++) {
        String str = Integer.toHexString(arrayOfByte[b] & 0xFF);
        if (str.length() == 1)
          stringBuilder.append('0'); 
        stringBuilder.append(str);
      } 
      return stringBuilder.toString();
    } catch (NoSuchAlgorithmException noSuchAlgorithmException) {
      RuntimeException runtimeException = new RuntimeException("SHA-1 algorithm not found", noSuchAlgorithmException);
      throw runtimeException;
    } 
  }
  
  public static String h(String paramString, Charset paramCharset) {
    try {
      byte[] arrayOfByte = MessageDigest.getInstance("MD5").digest(paramString.getBytes(paramCharset));
      StringBuilder stringBuilder = new StringBuilder();
      this();
      for (byte b = 0; b < arrayOfByte.length; b++) {
        String str = Integer.toHexString(arrayOfByte[b] & 0xFF);
        if (str.length() < 2)
          stringBuilder.append(0); 
        stringBuilder.append(str);
      } 
      return stringBuilder.toString().toLowerCase();
    } catch (NoSuchAlgorithmException noSuchAlgorithmException) {
      noSuchAlgorithmException.printStackTrace();
      return "";
    } 
  }
  
  public static JSONObject j(JSONObject paramJSONObject, String paramString1, String paramString2) {
    JSONObject jSONObject = paramJSONObject;
    if (paramJSONObject == null)
      jSONObject = new JSONObject(); 
    if (paramString1.contains("www.mgtv.com")) {
      jSONObject.put("Referer", " ");
      jSONObject.put("User-Agent", " Mozilla/5.0");
    } else if (paramString2.contains("titan.mgtv")) {
      jSONObject.put("Referer", " ");
      jSONObject.put("User-Agent", " Mozilla/5.0");
    } else if (paramString1.contains("bilibili")) {
      jSONObject.put("Referer", " https://www.bilibili.com/");
      jSONObject.put("User-Agent", " Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36");
    } 
    return jSONObject;
  }
  
  public static boolean oC(String paramString) {
    // Byte code:
    //   0: iconst_0
    //   1: istore_3
    //   2: aload_0
    //   3: invokestatic parse : (Ljava/lang/String;)Landroid/net/Uri;
    //   6: invokevirtual getHost : ()Ljava/lang/String;
    //   9: astore #5
    //   11: bipush #12
    //   13: anewarray java/lang/String
    //   16: astore #4
    //   18: aload #4
    //   20: iconst_0
    //   21: ldc 'iqiyi.com'
    //   23: aastore
    //   24: aload #4
    //   26: iconst_1
    //   27: ldc 'v.qq.com'
    //   29: aastore
    //   30: aload #4
    //   32: iconst_2
    //   33: ldc 'youku.com'
    //   35: aastore
    //   36: aload #4
    //   38: iconst_3
    //   39: ldc 'le.com'
    //   41: aastore
    //   42: aload #4
    //   44: iconst_4
    //   45: ldc 'tudou.com'
    //   47: aastore
    //   48: aload #4
    //   50: iconst_5
    //   51: ldc 'mgtv.com'
    //   53: aastore
    //   54: aload #4
    //   56: bipush #6
    //   58: ldc 'sohu.com'
    //   60: aastore
    //   61: aload #4
    //   63: bipush #7
    //   65: ldc 'acfun.cn'
    //   67: aastore
    //   68: aload #4
    //   70: bipush #8
    //   72: ldc 'bilibili.com'
    //   74: aastore
    //   75: aload #4
    //   77: bipush #9
    //   79: ldc 'baofeng.com'
    //   81: aastore
    //   82: aload #4
    //   84: bipush #10
    //   86: ldc 'pptv.com'
    //   88: aastore
    //   89: aload #4
    //   91: bipush #11
    //   93: ldc '1905'
    //   95: aastore
    //   96: iconst_0
    //   97: istore_1
    //   98: iload_3
    //   99: istore_2
    //   100: iload_1
    //   101: bipush #12
    //   103: if_icmpge -> 170
    //   106: aload #5
    //   108: aload #4
    //   110: iload_1
    //   111: aaload
    //   112: invokevirtual contains : (Ljava/lang/CharSequence;)Z
    //   115: ifeq -> 164
    //   118: ldc 'iqiyi.com'
    //   120: aload #4
    //   122: iload_1
    //   123: aaload
    //   124: invokevirtual equals : (Ljava/lang/Object;)Z
    //   127: ifeq -> 159
    //   130: aload_0
    //   131: ldc 'iqiyi.com/a_'
    //   133: invokevirtual contains : (Ljava/lang/CharSequence;)Z
    //   136: ifne -> 159
    //   139: aload_0
    //   140: ldc 'iqiyi.com/w_'
    //   142: invokevirtual contains : (Ljava/lang/CharSequence;)Z
    //   145: ifne -> 159
    //   148: aload_0
    //   149: ldc 'iqiyi.com/v_'
    //   151: invokevirtual contains : (Ljava/lang/CharSequence;)Z
    //   154: istore_2
    //   155: iload_2
    //   156: ifeq -> 164
    //   159: iconst_1
    //   160: istore_2
    //   161: goto -> 170
    //   164: iinc #1, 1
    //   167: goto -> 98
    //   170: iload_2
    //   171: ireturn
    //   172: astore_0
    //   173: iload_3
    //   174: istore_2
    //   175: goto -> 170
    // Exception table:
    //   from	to	target	type
    //   2	18	172	java/lang/Exception
    //   106	155	172	java/lang/Exception
  }
  
  public static boolean q(String paramString1, String paramString2) {
    return (paramString2.contains("973973.xyz") || paramString2.contains(".fit:"));
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/CE.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */